package model;

import java.awt.Color;
import java.util.HashMap;

import model.playingfield.PlayingField;
import model.playingfield.Spot;

/**
 * @author christopher
 * This is the State. It represents the state of the game at any
 * point in time, and records, specifically: 
 * 
 * Regarding the players:
 * 		what players are currently playing the game 
 * 		where their pieces are 
 * 		whose turn it is to make a move
 * 
 * Regarding the game:
 * 		If the game is still running
 * 		what settings are in effect
 * 		 	Is music enabled?
 * 			Are sound effects enabled?
 */
public class State implements IState {
	
	// Players currently playing. Null indicates that the player is no longer in game.
	private HashMap<Integer, Player> players = new HashMap<Integer, Player>();
	
	// A representation of the playingfield	
	private PlayingField playingfield = new PlayingField(players);
	
	// The player currently having a turn
	private int current;
	
	// 
	
	@Override
	public int movePieceAt(Player player, int index, int moves) {
		return playingfield.movePieceAt(player, index, moves);	
	}

	/**
	 * remove a player from the game
	 */
	@Override
	public void removePlayer(Player player) {
		return;
	}
	
	@Override
	public void changeColor(Color color) {
		// TODO Auto-generated method stub
	}
	
	/**
	 * Update the turn counter of a given player
	 */
	@Override
	public void updateTurnCounter(Player player) {
		// TODO Auto-generated method stub
		
	}
	
	/**
	 * Update the time counter of a given player
	 */
	@Override
	public void updateTimeCounter(Player player, double time) {
		// TODO Auto-generated method stub
		
	}
	
	/**
	 * Select who is the current player
	 */
	@Override
	public void setCurrentPlayer(Player player) {
		// TODO Auto-generated method stub		
	}
	
	/**
	 * Get index of players currently in the game
	 */
	@Override
	public HashMap<Integer, Player> getPlayers() {
		// TODO Auto-generated method stub
		return players;
	}
	
	/**
	 * Return the current player making a turn.
	 */
	@Override
	public Player getCurrentPlayer() {
		// TODO Auto-generated method stub
		return null;
	}
	
	/**
	 * return current statistics for the game
	 */
	@Override
	public Statistics[] getStatistics() {
		// TODO Auto-generated method stub
		return null;
	}
	
	/**
	 * Return locations of player pieces. 
	 */
	@Override
	public HashMap<Player, Integer[]> getPlayerLocations() {
		// TODO Auto-generated method stub
		return playingfield.getPieceLocations();
	}
}